Skip to content

Document the Qwen GDN prompt kernels and forward their rollback to launchd - #1536

Merged
Gajesh2007 merged 10 commits into
masterfrom
ttft/qwen-gdn-prompt-kernels
Oct 22, 2026
Merged

Gajesh2007 merged 10 commits into
masterfrom
ttft/qwen-gdn-prompt-kernels

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

The bit-exact Qwen GDN prompt kernels (Layr-Labs/mlx-swift-lm#324) already reached master through #1535, whose libs/mlx-swift-lm pin 889fe3cc contains #324. After the rebase this PR moves no submodule. It documents the kernels that master now runs, and it forwards their rollback switch to the launchd provider job.

The kernels: gated DeltaNet prompt windows of at least 16 unmasked positions in qwen3_5, qwen3_5_moe and prism_hadamard_qwen35 models run a four-row recurrence kernel, 1.45-1.70x faster per layer on M5 Ultra. The first such window of each kernel instantiation checks on the GPU that the kernel reproduces the stock gated_delta_step bit for bit, and otherwise keeps the stock kernel. Outputs and recurrent checkpoint state do not change.

Change Files
Forward DARKBLOOM_TTFT_GDN_BLOCKED to the launchd provider job, so darkbloom start carries the stock-kernel rollback (0) into the background provider provider-swift/Sources/ProviderCore/Service/LaunchAgent.swift
Regression test: the forwarded value reaches the job and is parsed by the SDK's own GatedDeltaPrefill.Mode parser provider-swift/Tests/ProviderCoreTests/Service/LaunchAgentRestartTests.swift
GDN prompt-kernel paragraph: affected model types, the parity probe, the checkpoint invariant, the switch docs/architecture/inference.md
Per-GPU qualification section (probe, M5 Ultra and M3 Ultra measurements, transient probe memory, no capacity change) docs/architecture/hardware-support.md
DARKBLOOM_TTFT_GDN_BLOCKED rows: values, default, reading symbol, LaunchAgent forwarding docs/reference/configuration.md, docs/provider/cli-reference.md
Changelog fragment changelog.d/qwen-gdn-prompt-kernel.md

Before

flowchart TB
  subgraph PB["Behavior on master since #1535"]
    direction LR
    ob["Operator exports<br/>DARKBLOOM_TTFT_GDN_BLOCKED=0<br/>then runs darkbloom start"]:::input --> lb["LaunchAgent plist<br/>key not forwarded"]:::gap
    lb --> jb["launchd provider job<br/>four-row GDN kernels stay on"]:::gap
    fb["Foreground darkbloom<br/>or benchmark"]:::input --> sb["SDK GatedDeltaPrefill.mode<br/>reads the switch: stock kernel"]:::code
  end
  subgraph QB["Code and docs"]
    direction LR
    kb["LaunchAgent.inferencePassthroughEnvKeys<br/>no GDN key"]:::gap
    db["No docs or changelog<br/>for the GDN prompt kernels"]:::gap
  end
  PB ~~~ QB
  style PB fill:#f8fafc,stroke:#64748b,color:#0f172a
  style QB fill:#f8fafc,stroke:#64748b,color:#0f172a
  classDef input fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
  classDef code fill:#e0e7ff,stroke:#4338ca,color:#1e1b4b
  classDef gap fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
Loading

After

flowchart TB
  subgraph PA["Behavior with this PR"]
    direction LR
    oa["Operator exports<br/>DARKBLOOM_TTFT_GDN_BLOCKED=0<br/>then runs darkbloom start"]:::input --> la["LaunchAgent plist<br/>carries the key"]:::new
    la --> ja["launchd provider job<br/>SDK reads the switch: stock kernel"]:::new
    fa["Foreground darkbloom<br/>or benchmark"]:::input --> sa["SDK GatedDeltaPrefill.mode<br/>reads the switch: stock kernel"]:::code
  end
  subgraph QA["Code and docs"]
    direction LR
    ka["LaunchAgent.inferencePassthroughEnvKeys<br/>+ DARKBLOOM_TTFT_GDN_BLOCKED"]:::new --> ta["Test: forwarded value parses with<br/>the SDK's GatedDeltaPrefill.Mode"]:::new
    da["inference.md, hardware-support.md,<br/>configuration.md, cli-reference.md,<br/>changelog.d fragment"]:::new
  end
  PA ~~~ QA
  style PA fill:#f8fafc,stroke:#64748b,color:#0f172a
  style QA fill:#f8fafc,stroke:#64748b,color:#0f172a
  classDef input fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
  classDef code fill:#e0e7ff,stroke:#4338ca,color:#1e1b4b
  classDef new fill:#dcfce7,stroke:#15803d,color:#14532d
Loading

Legend: blue is operator input, indigo is unchanged code, red is the gap on master, green is what this PR adds. The kernel behavior itself (probe, four-row kernel, unchanged checkpoint bits) is already on master and is described in the sections below.

Measured effect (M5 Ultra, 80-core GPU)

Context for the documented kernels, which master already runs. These measurements were taken when this PR still carried the pin bump.

Measured by the implementer on the pre-rebase build: SDK a405b61e on 14661d9b. The kernel, dispatch and probe code in 1c9c255e is byte-identical. The three later SDK commits change comments, the indentation of one string literal whose value is unchanged (1c511d29, 1ec827e0), and one parameter of the dispatch helper plus a test (2debb5e8). The kernel sources, the probe and every dispatch decision are unchanged.

Per-layer GDN recurrence (bf16 inputs, fp32 state, interleaved rounds) stock four-row (packed) Speedup
Qwen3.5-9B / 35B-A3B geometry (Hk 16, Hv 32), T = 512 / 4,096 0.426 / 3.160 ms 0.294 / 1.930 ms 1.45x / 1.64x
Qwen3.8-27B geometry (Hk 16, Hv 48), T = 512 / 4,096 0.552 / 3.952 ms 0.377 / 2.332 ms 1.46x / 1.70x
Qwen3.5-9B quality, production engine, paged KV, MTP off Reference Result with the GDN build (probe selects packed)
Teacher-forced, 6 inputs x 256 tokens (--teacher-forced-input) Baseline master build, stock kernel Identical in every field: mean NLL 3.07511 / 3.86094 / 3.43206 / 3.08982 / 1.80982 / 2.10992 and all 6 x 256 plainTop1 tokens; only the executable hash and memory counters differ
Greedy generation, 44-token prompt, 64 tokens (--runtime-generation) Same build with DARKBLOOM_TTFT_GDN_BLOCKED=0 Token-identical
Qwen3.5-9B cold TTFT (--scheduler-prefill, 1 iteration per arm, one GPU ticket, shared GPU) 512 tokens 8,192 tokens 32,768 tokens
Probe, run 1 103.7 ms 1,416.6 ms 10,640.5 ms
Kill switch =0 (stock) 177.3 ms 1,646.6 ms 7,715.3 ms
Probe, run 2 150.4 ms 1,596.6 ms (−3.0%) 7,400.4 ms (−4.1%)
Estimate: 24 GDN layers x per-layer saving x 4,096-token chunks −3 ms −59 ms (−3.6%) −236 ms (−3.1%)

The end-to-end runs are single samples on a GPU shared with other jobs. Run 1 disagrees with run 2 in both directions. The 3-4% claim rests on the per-layer measurement and the estimate; run 2 agrees with it.

Side effects, verified in code

The Metal library and carried-change rows describe the pins master took with #1535; this PR no longer changes them.

Concern Finding
Metal library scripts/fetch-metallib.sh built mlx.metallib from nested MLX 71271f08. It is byte-identical to the cb77239b library: SHA-256 fb1ba8f90b9f1cc346246b7240c3986771464bd977c67f0ef03186811f16c85c for both. The MLX bump only moves host C++ (mlx/backend/metal/device.cpp, device.h, command_buffer_limits.h).
Memory, admission, capacity No KV, activation-floor, quotation or wire change. The probe allocates about 16 MiB at most, transiently, once per kernel instantiation and process (27B geometry: four 3 MiB fp32 states).
Prefix cache Kernel choice cannot change checkpoint bits; chunkPartitionsCarryStateBitwise covers partitions that mix stock-kernel and prompt-kernel chunks. As with any new provider build, the complete-checkpoint identity changes because it hashes the binary and the loaded metallib (provider-swift/Sources/ProviderCore/Inference/PrefixCache/PrefixCachePolicy+CheckpointIdentity.swift, buildID).
Rollback The SDK reads DARKBLOOM_TTFT_GDN_BLOCKED=0 once per process, on first use (GatedDeltaPrefill.mode). This PR adds it to LaunchAgent.inferencePassthroughEnvKeys, so it now reaches the launchd provider job as well as a foreground darkbloom process or benchmark. Any non-empty value is forwarded, including the A/B-only forced packed/rows modes.
Telemetry and privacy None. One os.Logger notice per instantiation records dtype, head counts, value head width and the selected kernel.
Carried SDK and MLX changes Layr-Labs/mlx-swift-lm#316 changes checkpoint-import staging, and its provider pair #1519 (open) carries its docs and live test. Layr-Labs/mlx-swift-lm#312, #315 and #317 add Nemotron Super code that this provider does not advertise. Layr-Labs/mlx-swift#52 and #57 do not change the returned GPU.deviceInfo() fields.

Validation

On the current head e73cfaa2b, CI is green: Provider Unit Tests (including forwardsGDNPromptKernelRollbackToProviderJob), Provider Tests, Provider SDK Tests, Provider Prompt Parity, Docs Lint, Docs Impact, Release Integrity and Commit Signatures. The local runs below were made when the PR still carried the pin bump.

Run on M5 Ultra in the work clone. Toolchain: Apple Swift 6.4 (Command Line Tools), XCTest and the Metal toolchain from Xcode 27.1, macOS SDK 27.0. The SDK tree that was built and tested is identical to 1c9c255e; only its commit message changed after the runs. Rows marked refactor pass ran on the final pins (libs/mlx-swift-lm 2debb5e8, commit 9282c7532).

Command Outcome
cd provider-swift && nice -n 15 swift build Build complete, 0 errors, with libs/mlx-swift 81f58d79 and libs/mlx-swift-lm 1c9c255e
./scripts/fetch-metallib.sh "$(cd provider-swift && swift build --show-bin-path)" mlx.metallib from nested MLX 71271f08: SHA-256 fb1ba8f90b9f1cc346246b7240c3986771464bd977c67f0ef03186811f16c85c, byte-identical to the cb77239b library. The refactor pass rebuilt it from source and got the same hash
cd provider-swift && nice -n 15 swift build --build-tests Build complete, 0 errors. The provider test targets compile against the new pins; they were not run
Refactor pass: cd provider-swift && nice -n 15 swift build, then swift build --build-tests Both complete, 0 errors, with libs/mlx-swift-lm 2debb5e8 (MLXLLM recompiled)
SDK focused GDN tests (see the SDK PR) Passed: 22 Swift Testing tests, 60/60 bitwise parity cases. XCTest suites: 12 tests, 0 failures. Refactor pass, on 2debb5e8: passed, 23 Swift Testing tests (60/60 bitwise, packed selected for all 6 instantiations) and 12 XCTest tests, 0 failures
make docs-impact-check BASE=origin/master canonical documentation coverage OK for 7 changed files: the 6 committed paths plus an uncommitted local provider-swift/Package.resolved resolution change, which is not part of this PR. Same result in the refactor pass
make docs-check 186 file(s) OK, before and after the refactor pass
python3 scripts/changelog.py check; make changelog-preview 27 valid fragment(s); the entry renders, before and after the refactor pass
mmdc on both figures, light and dark themes Both parse and render, before and after the refactor pass corrected the After figure

Not run here: make provider-test (the full provider suite), and new full-model measurements on the rebased build. The end-to-end evidence above comes from the pre-rebase build.

Limitations and landing order

  • Landing order. None. SDK Fix checkpoint KV restore crash guards #324 is merged and has been on master's pin since feat(provider): native Flint support and prefill projection optimization #1535; this PR changes no submodule.
  • M3 Ultra measured end to end: Qwen3.5-9B cold prefill 2K/8K/32K went 1,311.8/5,479.4/25,810.3 ms with the kill switch, and 1,296.5/5,407.8/25,529.4 ms (repeat 1,296.7/5,409.9/25,520.9) with the probe: -1.2%/-1.3%/-1.1%, A/B/A on one binary, exclusive GPU. Other M1-M4 chips are unmeasured. Correctness there is held by the probe. The SDK PR asks owners for M3 Ultra and M4 Max runs of DARKBLOOM_GDN_PREFILL_BENCH=1 swift test --skip-build --filter GatedDeltaPrefillTests (from libs/mlx-swift-lm, after swift build --build-tests and ../../scripts/stage-test-metallib.sh "$(swift build --show-bin-path)").
  • One-time probe cost on the first prompt window of at least 16 positions per kernel instantiation and process. A fresh test process probed 6 cold instantiations in 0.078 s in total; the Metal compiler cache may have been warm. One cold 44-token run had TTFT 131 ms with the probe and 83 ms with the kill switch, one noisy sample each. Startup calibration may absorb the cost; that was not checked.
  • The switch is now forwarded to the LaunchAgent (LaunchAgent.inferencePassthroughEnvKeys), with its rows in docs/provider/cli-reference.md and docs/reference/configuration.md. Forced A/B values (packed, rows) are forwarded too; restricting forwarding to the rollback spellings is a possible follow-up.
  • The switch name follows the TTFT program's DARKBLOOM_TTFT_* convention, and "blocked" is stale. A rename before release is a program-wide decision.
  • docs/architecture/components/mlx-swift.md lists pins that were already stale before this PR. It is left unchanged.
  • The Mermaid figures were rendered locally with mmdc in light and dark themes.

Refactor pass

This section records the refactor pass on the original pin-bump version; its pin changes have since landed on master via #1535.

An independent refactor subagent reviewed both PRs after the preparer's self-review. Its changes are behavior-preserving. They are in commits 863a0b026 and 9282c7532 here, and in SDK 1c511d29, 1ec827e0 and 2debb5e8.

Changes:

  • Pin. libs/mlx-swift-lm now points at 2debb5e8. The three refactor-pass SDK commits do four things:

    • correct two comments;
    • format Qwen4ExpGDNBlocked.swift, which re-indents one string literal without changing its value;
    • give the prompt-kernel dispatch the value head width once instead of twice;
    • add a test of the bit comparator that the probe relies on.

    The kernel sources, the probe and every dispatch decision are unchanged.

  • docs/architecture/inference.md.

    • The GDN paragraph now comes after the native Qwen3.5 vision paragraph. Before, it split the two Bonsai 9B paragraphs that feat: native Bonsai 9B with automatic rectangular MTP #1509 wrote together.
    • It now names the two kernels that the probe tries (packed, then rows), says that every process probes each kernel instantiation once, and says which kernels the switch can force. Its links to #context, prefix-cache.md#streamed-complete-checkpoints and configuration.md#engine-and-scheduler resolve.
  • docs/reference/configuration.md. The DARKBLOOM_TTFT_GDN_BLOCKED row moved to after DARKBLOOM_GEMMA4_PREFILL_CHUNK_EVAL, the other model-specific prefill control. Before, it split the MTP rows. Its text is unchanged.

  • Changelog.

    • The cold-TTFT saving is now stated as an estimate.
    • "The new kernels reproduce the existing kernel bit for bit" now reads "A new kernel runs only where it reproduces the existing kernel bit for bit", because packed is not bit-exact on every GPU.
  • This body.

    • The After figure sends chunks under 16 tokens, and windows with no bit-exact candidate, to the stock kernel. Before, every chunk passed through the parity check, and "none" fed into the four-row kernel.
    • The first-token node now says "an estimated".
    • The LaunchAgent forwarding note lists everything that forwarding would touch.
    • The privacy row lists every field of the probe's log line.

Checked in code, unchanged:

  • Eligible windows. CBv2 prefill (Qwen35GatedDeltaNet.cbv2Forward) passes mask: nil, so every CBv2 prompt chunk of 16 or more tokens is eligible.
  • MTP verify windows. They are at most 1 + CBv2MTPConfig.testedMaxDraftTokens = 8 positions. testedMaxDraftTokens is 7, and CBv2MTPConfig.init clamps to it.
  • Chunk defaults.
    • Per chunk, the kernel depends only on T, the mask, Dk, Dv and the cached probe answer.
    • Each CBv2 forward runs one whole computed range, and a recurrent checkpoint is captured only at the end of a range (CBv2RecurrentCheckpointGeometry.record). So T is the chunk size, not the 256-token checkpoint stride.
    • Chunks under 16 tokens stay on the stock kernel.
    • So smaller chunk defaults lower the gain (1.45x at 512, 1.58x at 2,048, 1.64x at 4,096; 9B geometry) but never change bits (chunkPartitionsCarryStateBitwise).
  • Qwen4. qwen4_exp and qwen4_exp_text build Qwen35GatedDeltaNet with .qwen4L2. That sets useBlockedSeq, so their windows take the blocked-seq or the stock kernel and never reach the new path.
  • This body's claims. LaunchAgent.passthroughEnvKeys and inferencePassthroughEnvKeys do not contain the switch. buildID in PrefixCachePolicy+CheckpointIdentity.swift hashes the binary and the loaded metallib.
  • Package.resolved. The uncommitted change is SwiftPM re-resolving swift-syntax from 603.0.1 to 603.0.2, inside the SDK's unchanged 600.0.0 ..< 604.0.0 range. No pin bump since 0.9.0 has committed this file, so it stays uncommitted.

Findings for reviewers, not changed here:

  • docs/architecture/components/mlx-swift.md lists 67153a87, a486a55d and 0a725e30. master already pins 6923a80f, 14661d9b and cb77239b, so that table was stale before this PR.
  • The SDK body records the SDK test findings:
    • No test fails if the fast path stops being dispatched.
    • If packed regressed on M5, the probe would quietly select rows.
    • One Double-reference test takes about a minute in a debug build.
  • Forwarding the switch, renaming it and the landing order stay open, as listed under Limitations.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Gajesh2007 and others added 3 commits October 21, 2026 16:11
Qwen3.5/3.6/3.8 and Bonsai 2 prompt windows of 16 or more unmasked
positions run their Gated DeltaNet recurrence on four-row kernels that
reproduce the stock gated_delta_step bit for bit, so outputs and recurrent
checkpoints do not change. On M5 Ultra the recurrence is 1.64x (9B and
35B-A3B geometry) and 1.70x (27B geometry) faster per layer at a
4,096-token chunk. The first prompt window of each kernel instantiation
checks bit parity on the GPU and keeps the stock kernel where no candidate
matches. DARKBLOOM_TTFT_GDN_BLOCKED=0 restores the stock kernel; the
configuration reference and the inference architecture page describe the
switch and the check.

The SDK commit sits on mlx-swift-lm main, which already carries
mlx-swift-lm #316 and the Nemotron Super stack (mlx-swift-lm #312, #315,
#317). Its Package.swift requires mlx-swift 81f58d79, whose
GPU.CommandBufferLimits (mlx-swift #57) MLXLMCommon uses, so libs/mlx-swift
moves to that commit and libs/mlx to its nested MLX 71271f08 (mlx #36).
That MLX change is host-side only: mlx.metallib built from it is
byte-identical to the current one (SHA-256 fb1ba8f9...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves libs/mlx-swift-lm from 1c9c255e to 1ec827e0. The two added SDK
commits change only comments and the formatting of one string literal
(format Qwen4ExpGDNBlocked.swift; correct two GDN kernel-selection
comments), so no code or kernel changes.

docs/architecture/inference.md: the Gated DeltaNet paragraph now follows
the native Qwen3.5 vision paragraph instead of separating it from the
Bonsai adapter paragraph it was written with, and says that the probe
tries the candidates in order. The changelog fragment gives the cold
time-to-first-token saving as the estimate it is, and says that a new
kernel runs only where the GPU check finds it bit-exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves libs/mlx-swift-lm from 1ec827e0 to 2debb5e8. The added SDK commit
gives the prompt-kernel dispatch the value head width once instead of
twice and adds a test of the bit comparator that the probe relies on.
The kernel sources, the probe and every dispatch decision are unchanged.

docs/architecture/inference.md now names the two kernels the probe tries
(packed, then rows), says that every process probes each kernel
instantiation once, and says which kernels the switch can force.

docs/reference/configuration.md moves the DARKBLOOM_TTFT_GDN_BLOCKED row
after DARKBLOOM_GEMMA4_PREFILL_CHUNK_EVAL, the other model-specific
prefill control, so that it no longer splits the MTP rows. The row's
text is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 22, 2026 1:55am UTC
d-inference-console-ui-dev Ready Ready Preview Oct 22, 2026 1:55am UTC
d-inference-landing Ready Ready Preview Oct 22, 2026 1:55am UTC
darkbloom-status Ready Ready Preview Oct 22, 2026 1:55am UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 22, 2026 1:55am UTC

Request Review

Refresh before review. master (#1519) now pins mlx-swift 67dc7528 and MLX
ad4745a2; keep those, and pin libs/mlx-swift-lm to the SDK branch's merge of
main (f4be1ba1), which carries the GDN kernels on top of the SDK commit
master pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T01:57:50.969865Z e73cfaa New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head e73cfaa2b8f2 against base a591744a2ed9.

Reviewers: anthropic/claude-sonnet-5.5: first pass completed; anthropic/claude-opus-5.5: selected depth completed (17 batches); openai/gpt-6.1-sol: not needed by escalation policy

No actionable findings in the reviewed text. This is not a security approval.

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Scan completed; human review required.
Cross-file reviewer requests further review; independent human review required

Coverage: 51/51 source units; cross-file integration complete. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 7 reused batch(es), 0 provider cache-hit tokens.

Saved findings and earlier report · Historical findings are not confirmed resolved.

Bedrock: 28 request(s), 1342576 uncached + 0 cache-read + 0 cache-write input / 19466 output tokens; 0 request(s) with unknown usage. OpenRouter backup used 0 time(s). Dollar amounts above cover OpenRouter only; AWS billing is reconciled separately.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e28b8573b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread libs/mlx-swift-lm Resolved
Comment thread docs/reference/configuration.md Resolved
Gajesh2007 and others added 2 commits October 21, 2026 17:30
Layr-Labs/mlx-swift-lm#324 squash-merged as 921bfa69 ("Run Qwen GDN prompt windows on bit-exact four-row kernels (#324)").
Move the gitlink from the PR branch head f4be1ba1 to that commit on SDK main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refresh before review: master moved (Nemotron Super and SDK pin updates; it now
pins SDK 0351444e, mlx-swift 67dc7528 and MLX ad4745a2). Keep master's mlx-swift
and MLX pins and pin libs/mlx-swift-lm to 921bfa69 (the paired SDK PR head).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gajesh2007 and others added 2 commits October 21, 2026 17:51
Refresh before review: master moved (Nemotron Super and SDK pin updates; it now
pins SDK 889fe3cc, mlx-swift 67dc7528 and MLX ad4745a2). Keep master's mlx-swift
and MLX pins and pin libs/mlx-swift-lm to .

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK keeps a four-row Qwen GDN prompt kernel wherever its parity probe
finds it bit-exact on the GPU; the probe compares bits, not speed. Where a
kept kernel is slower, DARKBLOOM_TTFT_GDN_BLOCKED=0 is the recovery, but
launchd does not inherit the installing shell, so the export reached only a
foreground provider: the background provider job kept probing, and restarts
and watchdog recovery reuse its saved plist. Add the key to
LaunchAgent.inferencePassthroughEnvKeys so darkbloom start persists it into
the provider plist. The watchdog plist stays without it: it never runs
inference.

The key is spelled out because its SDK reader (GatedDeltaPrefill.mode) is
internal to MLXLLM. The new LaunchAgentEnvironmentTests case reads the SDK's
own key and parser through @testable import MLXLLM: for unset, empty, 0,
" OFF ", packed, rows and an unknown value, the provider plist resolves the
same mode as the foreground shell, so renaming the key fails it.

Docs: the configuration row says the key is forwarded and that the probe
does not compare speed; the CLI reference lists it among the forwarded
variables; the changelog fragment no longer says the LaunchAgent does not
receive it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/AGENTS.md section 7 has native-inference changes move
architecture/hardware-support.md with architecture/inference.md and record an
external capacity compatibility review; this PR only touched inference.md.
Add a "GDN prompt kernels by GPU" section after "Cross-repository agreement":

- Qualification: no chip list selects the kernel. In each process the first
  eligible window of each kernel instantiation compares the candidates with
  gated_delta_step on a fixed 32-position window on that GPU and keeps the
  first bit-exact one, or the stock kernel (GatedDeltaPrefill.probe), so every
  chip keeps the stock kernel's bits. The probe does not compare speed, which
  is what DARKBLOOM_TTFT_GDN_BLOCKED restores.
- Measured: M5 Ultra per-layer recurrence 1.45-1.70x faster, with packed kept
  at the 9B, 27B and 35B-A3B head geometries; M3 Ultra Qwen3.5-9B cold prefill
  1.1-1.3% less time at 2K/8K/32K (A/B/A on one binary). Every other GPU is
  unmeasured; GatedDeltaPrefillTests prints per-layer timings with
  DARKBLOOM_GDN_PREFILL_BENCH=1.
- Capacity: the selected kernel has the stock kernel's inputs, outputs and
  fp32 state; the probe is transient, once per instantiation and process, at
  most about 16 MiB at Qwen3.8-27B (four 3 MiB fp32 states and a 32-position
  window). No full-load quotation, activation floor, KV grant or reported
  capacity field changes, so platform admission needs no change.

The changelog fragment's "Speed on M1-M4 GPUs is unmeasured" now records the
M3 Ultra measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 251202f41d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/architecture/hardware-support.md Resolved
The GDN rollback forwarding and the hardware-support GPU qualification
were committed at 2026-10-22T01:10:38Z, but the pages they edit still
said 2026-10-21. Restamp them with `make docs-stamp` (today, UTC):

- docs/architecture/hardware-support.md
- docs/provider/cli-reference.md
- docs/reference/configuration.md

docs/architecture/inference.md keeps 2026-10-21. This branch last edited
it at 2026-10-21T23:11:14Z; the later merges from master changed it only
by bringing in master's own content, with no hand edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gajesh2007 Gajesh2007 changed the title Pin mlx-swift-lm to the bit-exact Qwen GDN prompt kernels Document the Qwen GDN prompt kernels and forward their rollback to launchd Oct 22, 2026
@Gajesh2007
Gajesh2007 merged commit 1a76696 into master Oct 22, 2026
31 checks passed

This branch was successfully deployed

5 active deployments
Preview – d-inference-landing — e73cfaa2 Deployed Oct 22, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — e73cfaa2 Deployed Oct 22, 2026 by vercel[bot]
Preview – d-inference — e73cfaa2 Deployed Oct 22, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — e73cfaa2 Deployed Oct 22, 2026 by vercel[bot]
Preview – darkbloom-status — e73cfaa2 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants